package com.entity;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Author ri.yang
 * @Since 2016/1/6.
 */
public class Score implements Serializable {


    private Integer id;
    //学生学号
    private String stuNo;
    //课程编号
    private Integer courseNo;
    //学习课时
    private Integer learnCourseTime;
    //分数
    private BigDecimal score=BigDecimal.ZERO;
    //学生实际学分
    private BigDecimal credit;

    public BigDecimal getCredit() {
        return credit;
    }

    public void setCredit(BigDecimal credit) {
        this.credit = credit;
    }

    public Score() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStuNo() {
        return stuNo;
    }

    public void setStuNo(String stuNo) {
        this.stuNo = stuNo;
    }

    public Integer getCourseNo() {
        return courseNo;
    }

    public void setCourseNo(Integer courseNo) {
        this.courseNo = courseNo;
    }

    public Integer getLearnCourseTime() {
        return learnCourseTime;
    }

    public void setLearnCourseTime(Integer learnCourseTime) {
        this.learnCourseTime = learnCourseTime;
    }

    public BigDecimal getScore() {
        return score;
    }

    public void setScore(BigDecimal score) {
        if(score.compareTo(BigDecimal.valueOf(100))>0||score.compareTo(BigDecimal.ZERO)<0){
            throw  new RuntimeException("invalid score");
        }
        this.score = score;
    }
}
